package br.com.certificacao.Conjuntos;

public class Programa1 {
	int a;
	String b;
	Programa1(int a, String b){
		this.a = a;
		this.b = b;
	}
	public boolean equals(Object o){
		if((o instanceof Programa1) && (((Programa1)o)).b.equals(this.b))
			return true;
		else 
			return false;
	}
	public static void main(String[] args) {
		Programa1 p = new Programa1(10,"?Java?");
		Programa1 p1 = new Programa1(23,new String("?Java?"));
		Programa1 p2 = new Programa1(90,"?Java?");
		System.out.println(p.equals(p1));//true
		System.out.println(p.equals(p2));//true
		System.out.println(p1.equals(p2));//true
	}

}
